
<%@ page import="master.photo.domain.Profile" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'profile.label', default: 'Profile')}" />
        <g:set var="albumEntityName" value="${message(code: 'photoAlbum.label', default: 'Photo Album')}" />
        <title><g:message code="default.show.label" args="[entityName]" /></title>
    </head>
    <body>
    	<g:set var="isAdmin" value="${session['USER_LOGGED_IN'].userRole.id == 1}" />
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span>
            <g:if test="${isAdmin}">
            	<span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
            	<span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
            </g:if>
            <g:else>
            	<span class="menuButton"><g:link class="list" controller="friend" action="list">Friend list</g:link></span>
            	<span class="menuButton"><g:link class="create" controller="photoAlbum" action="create"><g:message code="default.new.label" args="[albumEntityName]" /></g:link></span>
            </g:else>
            <span class="menuButton"><g:link class="list" controller="photoAlbum" action="list" id="${params.id}"><g:message code="default.list.label" args="[albumEntityName]" /></g:link></span>
            <span class="menuButton"><a class="logout" href="${createLink(uri: '/logout')}">Logout</a></span>
        </div>
        <div class="body">
            <h1><g:message code="default.show.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <div class="dialog">
                <table>
                    <tbody>
                    
                        <tr class="prop">
                            <td valign="top" class="name"><g:message code="profile.id.label" default="Id" /></td>
                            
                            <td valign="top" class="value">${fieldValue(bean: profileInstance, field: "id")}</td>
                            
                        </tr>
                    
                        <tr class="prop">
                            <td valign="top" class="name"><g:message code="profile.fullname.label" default="Fullname" /></td>
                            
                            <td valign="top" class="value">${fieldValue(bean: profileInstance, field: "fullname")}</td>
                            
                        </tr>
                    
                        <tr class="prop">
                            <td valign="top" class="name"><g:message code="profile.bio.label" default="Bio" /></td>
                            
                            <td valign="top" class="value">${fieldValue(bean: profileInstance, field: "bio")}</td>
                            
                        </tr>
                    
                        <tr class="prop">
                            <td valign="top" class="name"><g:message code="profile.homepage.label" default="Homepage" /></td>
                            
                            <td valign="top" class="value">${fieldValue(bean: profileInstance, field: "homepage")}</td>
                            
                        </tr>
                    
                    	<tr class="prop">
                            <td valign="top" class="name">
                            	<g:message code="profile.photo.label" default="Photo" />
                            </td>
                            <td valign="top" class="value">
                            	<img src="${createLink(controller: 'profileImage', action: 'show', id: profileInstance?.id)}" />
                            </td>
                        </tr>
                    
                    </tbody>
                </table>
            </div>
            <div class="buttons">
                <g:form>
                    <g:hiddenField name="id" value="${profileInstance?.id}" />
                    <span class="button"><g:actionSubmit class="edit" action="edit" value="${message(code: 'default.button.edit.label', default: 'Edit')}" /></span>
                    <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
                </g:form>
            </div>
        </div>
    </body>
</html>
